<link rel="stylesheet" type="text/css" href="/assets/css/tableform.css">
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">仓库:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-warehouse_id" data-rule="required" data-source="information/warehouse/index" class="form-control selectpage table-input" name="row[warehouse_id]" placeholder="请选择仓库" type="text" value="">
        </div>
        <label class="control-label col-xs-12 col-sm-2">{:__('Warehouse_change_id')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-warehouse_change_id" data-rule="required" data-source="information/warehouse/index" class="form-control selectpage" name="row[warehouse_change_id]"  placeholder="请选择仓库"type="text" value="">
        </div>

    </div>
    <div class="row-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Code_date')}:</label>
        <div class="col-xs-12 col-sm-4" style="margin-left: -10px;">
            <input id="c-code_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[code_date]" type="text" value="{:date('Y-m-d')}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2" style="margin-left: 15px;">选择库存:</label>
        <a href="javascript:;"  id="choose-goods" style="margin-left: 15px;"  class="col-sm-1 btn btn-success" title="打开选择" ><i class="fa fa-plus"></i> 选择</a>
    </div>
    <a href="javascript:;"  id="choose-kc" style="display:none;"  class="col-sm-1 btn btn-success" title="打开选择" ><i class="fa fa-plus"></i> 选择</a>
    
<!--    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"width="100%"></table>-->
    <div style="white-space: nowrap;overflow-x: auto;width:100%">
        <table class="table fieldlist table-nowrap" data-template="basictpl"
               id="free-programme-item-table" data-name="row[basic]">

            <tr class="table-bordered">
                <!--<td class="text-center table-bordered" width="60">{:__('序号')}</td>
                <td class="text-center table-bordered" width="120">{:__('源单单据编号')}</td> -->
                <td class="text-center table-bordered" width="100">{:__('物料编码')}</td>
                <td class="text-center table-bordered" width="200">{:__('物料名称')}</td>
                <td class="text-center table-bordered" width="150">{:__('规格型号')}</td>
                <td class="text-center table-bordered" width="150">{:__('单位')}</td>
                <td class="text-center table-bordered" width="150">{:__('数量')}</td>
                <td class="text-center table-bordered" width="100">{:__('原库区/货架')}</td>
                <td class="text-center table-bordered" width="80">{:__('调拨库区/货架')}</td>
                <td class="text-center table-bordered" width="100">{:__('调拨数量')}</td>
                <td class="text-center table-bordered" width="150">{:__('操作')}</td>
                <td class="text-center table-bordered" width="40"></td>
            </tr>
        </table>
    </div>

    <!--请注意实际开发中textarea应该添加个hidden进行隐藏-->
    <textarea name="row[basic]" id="c-basic-textarea" class="form-control hidden" cols="30" rows="5">[]</textarea>
    <script id="basictpl" type="text/html">
        <tr class="table-bordered">
            <td class="text-center table-bordered">
                <%=value?value['cInvCode']:''%>
                <input type="hidden" name="<%=name%>[<%=index%>][id]" id="input_id_<%=index%>" class="form-control table-input " value="<%=value?value['id']:''%>"/></td>
            <input type="hidden" name="<%=name%>[<%=index%>][cInvCode]" id="input_cInvCode_<%=index%>" class="form-control table-input " value="<%=value?value['cInvCode']:''%>"/></td>
            </td>
            <td class="text-center table-bordered"><%=value?value['name']:''%></td>
            <td class="text-center table-bordered"><%=value?value['specification']:''%></td>
            <td class="text-center table-bordered"><%=value?value['unit']:''%></td>
            <td class="text-center table-bordered"><%=value?value['iQuantity']:''%></td>
            <td class="text-center table-bordered"><%=value?value['shname']:''%><input type="hidden"   name="<%=name%>[<%=index%>][shelves_id]"  class="form-control" value="<%=value?value['shelves_id']:''%>" ></td>
            <td class="text-center table-bordered">
                <input class="c-shelves_id" style="display:none;" name="<%=name%>[<%=index%>][shelves_change_id]" type="text" value="<%=value?value['shelves_change_id']:''%>"/>
                <input type="text" name="<%=name%>[<%=index%>][change_shname]" value="" data-rule="required" class="form-control c-shelves_name"  readonly style="width: 160px;"/>
                <a href="javascript:;"   class="btn btn-success choose-shelves col-sm-offset"  onclick="selectshelves(this)" title="打开选择" >
                    <i class="fa fa-plus"></i> 选择
                </a>
            </td>
            <td class="text-center table-bordered">
                <%=value?value['tp_iQuantity']:''%>
                <input type=text  style="width:100px;"  name="<%=name%>[<%=index%>][tp_iQuantity]"  value="" class="form-control change_iquantity" data-rule="required"></td>
            <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span></td>
        </tr>
    </script>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
